<!doctype html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp"%>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>山东林业扶贫项目</title>
  <meta name="description" content="山东林业扶贫项目">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="${ctxStatic}/sdlyfp/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="${ctxStatic}/sdlyfp/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="${ctxStatic}/sdlyfp/css/amazeui.min.css" />
  <link rel="stylesheet" href="${ctxStatic}/sdlyfp/css/admin.css">
  <link rel="stylesheet" href="${ctxStatic}/sdlyfp/css/app.css">
  <script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
  <link rel="stylesheet" href="${ctxStatic}/sweetalert/sweetalert.css">
  <script src="${ctxStatic}/sweetalert/sweetalert.min.js"></script>
  <script src="${ctxStatic}/sdlyfp/js/base.js"></script>
  
</head>

<body data-type="generalComponents">

	<!-- head -->
	<jsp:include page="head.jsp" flush="false"></jsp:include>
	
	<div class="tpl-page-container tpl-page-header-fixed">
	
	<!-- 菜单 -->
	<jsp:include page="menu.jsp" flush="false"></jsp:include>


        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                                 区域设置
             <c:if test="${fns:getUser().area.type gt 2}">
            	&nbsp;<font style="font-size: 17px;" color="red"><b>提示：
            	当新增或者修改区域时，在填写各项任务目标时，请勿随意填写数字，必须按照实际值填写，否则将直接导致数据统计错误；对于不确定的任务目标请填写数字0。</b></font>
            	</c:if>
               
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li> 
                <li class="am-active">区域设置</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 区域列表
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                        <div class="portlet-input input-small input-inline">
                            <div class="input-icon right">  <a href="${ctx }/gt/area/form?menuId=${gtArea.menuId }"><button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button></a>
                                 </div>
                        </div>
                    </div>
                </div>
                <div class="tpl-block">
                <form class="am-form" method="post" action="${ctx }/gt/area">
                	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
					
					<input type="hidden" id="menuId" name="menuId" value="${gtArea.menuId }"/>
					
                    <div class="am-g">
                        
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                  
                            </div>
                        </div>
						  <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                   
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" name="name" class="am-form-field">
                                <span class="am-input-group-btn">
						            <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
						          </span>
                            </div>
                        </div>
                    </div>
                    </form>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                        	<th class="table-title">区域编号</th>
                                            <th class="table-title">区域名称</th>
                                            <th class="table-title">上级区域</th>
                                            <th class="table-title">层次</th>
                                            <!-- <th class="table-title">编码</th> -->
                                            <!-- <th class="table-title">序号</th> -->
                                            <th class="table-type">经济林任务目标</th>
											<th class="table-type">经济林人数</th>
											<th class="table-type">护林岗任务目标</th>
											<th class="table-type">龙头企业任务目标</th>
											<th class="table-type">合作社任务目标</th>
											<th class="table-type">贫困村任务目标</th> 
                                            <th class="table-set">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        
                                        <c:forEach items="${page.list }" var="area">
                                        	<tr>
                                        	<td>${area.id }</td>
                                            <td><!-- <A href="jiagou2.html"> -->${area.name }<!-- </a> --></td>
                                            <td>${area.parent.name }</td>
                                            <td>
                                            	${area.type eq '1'?'国家':area.type eq '2'?'省、直辖市':area.type eq '3'?'地市':
                                            	area.type eq '4'?'区县':area.type eq '5'?'乡镇':'村'}
                                            </td>
                                            <%-- <td>${area.code }</td> --%>
                                            <%-- <td>${area.sort }</td> --%>
                                            <td>${area.forestArea }</td>
                                            <td>${area.forestPeople }</td>
                                            <td>${area.rangerPost }</td>
                                            <td>${area.leadCompany }</td>
                                            <td>${area.coop }</td>
                                            <td>${area.countryTotal }</td> 
                                            <td>  
                                            	<div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                    
                                                        <a href="${ctx }/gt/area/form?id=${area.id}&menuId=${gtArea.menuId }" class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                                        <span class="am-icon-pencil-square-o"></span> 修改</a></a>
                                                        
                                                        <!-- 只有省级账号才可以删除组织机构 -->
                                                        <c:if test="${fns:getUser().area.type lt 3}">
	                                                        <button type="button" onclick="return del('${area.id}');" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">
	                                                        <span class="am-icon-trash-o"></span> 删除</button>
                                                        </c:if>
                                                        
                                                        <c:if test="${area.type lt 5}">
															<a href="${ctx }/gt/area/form?parent.id=${area.id}&menuId=${gtArea.menuId }" class="am-btn am-btn-default am-btn-xs am-hide-sm-only">
															<span class="am-icon-plus"></span> 添加下级</a>
														</c:if>
                                                    </div>
                                                </div>
                                            </td> 
                                        </tr>
                                        </c:forEach>
                                        
                                        
                                    </tbody>
                                </table>
                                
                                <div class="am-cf">

                                    <!-- <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div> -->
                                    
                                    ${page}
                                    
                                </div>
                                <hr>

                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>



        </div>

    </div>

  <script src="${ctxStatic}/sdlyfp/js/jquery.min.js"></script>
  <script src="${ctxStatic}/sdlyfp/js/amazeui.min.js"></script>
  <script src="${ctxStatic}/sdlyfp/js/app.js"></script>
</body>
<script type="text/javascript">
$(document).ready(function() {
	
	var menuId = '${gtArea.menuId }';
	if(menuId)
	{
		$(".tpl-left-nav-menu").find("#"+menuId).addClass("active");
	}
	
	var message = "${message}";
	if(message)
	{
		var messageType = "${messageType}";
		msg(message,3000,messageType);
	}
});

function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	document.forms[0].submit();
	return false;
}

function del(areaId)
{
	
	var content = "您确认要删除吗？";
	var url = ctx + "/gt/area/delete?id=" + areaId + "&menuId=${gtArea.menuId }";
	comfirmMsg(content,url,"warning");
}
</script>
</html>